import React from 'react';
import { history } from 'umi';
import { Button, Modal, Icon } from 'antd-mobile';

let BackIcon = (props) => {
  console.log(
    ['service', 'homepage', 'center'].some(
      (it) => window.location.hash.indexOf(it) != -1,
    ),
  );
  return (
    <div
      style={{
        position: 'fixed',
        left: 12,
        top: 12,
        width: 40,
        height: 40,
        backgroundColor: '#fff',
        borderRadius: 60,
        display: ['service', 'homepage', 'center'].some(
          (it) => window.location.hash.indexOf(it) != -1,
        )
          ? 'none'
          : 'flex',
        justifyContent: 'center',
        alignItems: 'center',
        color: 'rgb(16, 142, 233)',
        zIndex: 9999,
        boxShadow: '0 0 4px #666',
      }}
      onClick={() => {
        history.go(-1);
      }}
    >
      <Icon type="left" style={{ color: 'rgb(16, 142, 233)' }} size="md" />
    </div>
  );
};

export default BackIcon;
